package game.model.impl

import game.Config
import game.business.AttackAble
import game.business.BlockAble
import game.business.DestroyAble
import game.business.SufferAble
import game.model.View
import org.itheima.kotlin.game.core.Painter

/**
 * 铁墙
 *
 * 具有阻塞功能
 * 具有被攻击能力
 */
class Steel(override val x: Int, override val y: Int): BlockAble, SufferAble, DestroyAble {

/*    override val x: Int = 200
    override val y: Int = 200*/

    override var width: Int = Config.block
    override var height: Int = Config.block

    override var blood: Int = Config.SteelBlood

    override fun draw() {
        Painter.drawImage("img/steel.gif",x,y)
    }

    override fun notifySuffer(attackAble: AttackAble): Array<View>? {
        blood -= attackAble.attackPower
        return arrayOf(Blast(x,y))
    }

    override fun isDestroyed(): Boolean  = blood <= 0

/*    //位置
    var x:Int = 100
    var y:Int = 100

    //宽高
    var width:Int = Config.block
    var height:Int = Config.block

    //显示
    fun draw(){
        Painter.drawImage("img/grass.png",200,200)
    }*/
}